const Router = require('koa-router')
const router = new Router()
const User = require('../../db/controllers/user')
const routers = router



routers.post('/auth/login',User.login)
routers.post('/login/init',User.loginInit)
routers.get('/user/info', User.getUser)
routers.put('/user/info', User.editUser)
// 购物车相关
routers.get('/ship/cart',User.getShipCart) // 获取购物车列表
routers.post('/ship/cart',User.addShipCart) // 添加购物车
routers.put('/ship/cart',User.editShipCart) //修改
routers.delete('/ship/cart',User.deleteShipCart) //删除
routers.get('/ship/goods',User.getShipGoods) //获取商品

// 地址相关
routers.get('/ship/address',User.getAddress) // 获取地址列表
routers.post('/ship/address',User.addAddress) // 添加地址
routers.put('/ship/address',User.editAddress) //修改地址
routers.delete('/ship/address',User.deleteAddress) //删除地址

module.exports = routers